package com.b2bpsssm.controller.material.commodity;


import com.b2bpsssm.common.R;
import com.b2bpsssm.pojo.CommodityProperty;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Api(value = "商品属性页面",tags = "商品属性接口Api")
public class CommodityPropertyController {
    /*
     * 商品属性查询
     * */
    @RequestMapping(value = "/commodity/queryCommodityPropertyByPageLimit",method = RequestMethod.GET)
    @ApiOperation(value = "查询商品属性",notes = "显示商品属性",httpMethod = "get",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page",value = "当前页码",required = true),
            @ApiImplicitParam(name = "limit",value = "每页条数",required = true)
    })
    @ResponseBody
    public R queryCommodityPropertyByPageLimit(Integer page, Integer limit){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }



    /*
     * 新增属性
     * */
    @RequestMapping(value = "/commodity/addCommodityProperty",method = RequestMethod.POST)
    @ApiOperation(value = "新增商品属性",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "com_Pro_Create_Date",value = "创建时间",required = true),
            @ApiImplicitParam(name = "com_Pro_Name",value = "属性名称",required = true),
            @ApiImplicitParam(name = "com_Pro_Value",value = "属性值",required = true),
    })
    @ResponseBody
    public R addCommodityProperty(CommodityProperty CommodityProperty){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 删除商品属性
     * */
    @RequestMapping(value = "/commodity/delCommodityProperty",method = RequestMethod.POST)
    @ApiOperation(value = "新增商品属性",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "com_Pro_Name",value = "属性名称",required = true),
    })
    @ResponseBody
    public R delCommodityProperty(String comClaName){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }

    /*
     * 修改属性
     * */
    @RequestMapping(value = "/commodity/updateCommodityProperty",method = RequestMethod.POST)
    @ApiOperation(value = "修改商品属性",notes = "新增并保存",httpMethod = "post",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "com_Pro_Create_Date",value = "创建时间",required = true),
            @ApiImplicitParam(name = "com_Pro_Name",value = "属性名称",required = true),
            @ApiImplicitParam(name = "com_Pro_Value",value = "属性值",required = true),
    })
    @ResponseBody
    public R updateCommodityProperty(CommodityProperty CommodityProperty){
        R r = new R();
        r.setCode(200);
        r.setData(666);
        r.setMassage("success");
        return r;
    }
}
